<template>
  <div class="hello">
    <h2>东软HIS</h2>
    <el-input v-model="input" placeholder="请输入科室编号或名称" style="width: 300px;float: left;"></el-input>
    &nbsp;&nbsp;&nbsp;
    <el-button @click="submitClick" >查询科室</el-button>
    &nbsp;&nbsp;&nbsp;
    <el-button @click="getinsert">新增科室</el-button>
    <br /><br />
    <el-table :data="msg" style="width: 100%">
        <el-table-column prop="deptCode" label="科室编号" width="180"></el-table-column>
        <el-table-column prop="deptName" label="科室名称" width="180"></el-table-column>
        <el-table-column prop="constantName" label="科室分类" width="180"></el-table-column>
        <el-table-column prop="deptType" label="科室类型" width="180"></el-table-column>
        <el-table-column label="操作">
         <template slot-scope="scope">
                <el-button size="mini" @click="getIdClickup(scope.$index, scope.row)">编辑</el-button>
                <el-button size="mini" type="danger"  @click="getIdClickde(scope.$index, scope.row)">删除</el-button>
         </template>
        </el-table-column>
      </el-table>
      <div style="background-color: darkgray;height: 50px;width: 100%;display: flex;align-items: center;">
        <el-row style="width: 40%;align-items: center;justify-content: center;">
          <el-button type="danger" >批量删除</el-button>
        </el-row>
        <el-pagination background layout="prev, pager, next" :total="1000"></el-pagination>
      </div>
    </div>
</template>

<script>
  export default {
    name: 'keshi',
    mounted:function(){
      //this.submitClick();
    },
     data() {
       return {
         msg:[{
           deptCode:'',
           deptName:'',
           constantName:'',
           deptType:''
         }],
         input:''
       }
     },
     methods: {
       submitClick(){
         let _this = this;
       this.$axios.get("/neusys/user/toadd")
         .then(response=>{
           _this.msg=response.data.deptList;
         })
         .catch();
       },
       getinsert(){
         let _this = this;
       this.$router.push("/keshi/insert")
       }
     }
   }
</script>

<style>
</style>
